<%/*
@STI LICENSE
(C) 2006-2008 Universit�t Innsbruck.

This file is part of myOntology.

myOntologyis free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

myOntologyis distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with myOntology.  If not, see <http://www.gnu.org/licenses/>.

@STI LICENSE */%>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page buffer="24kb" %><%-- buffer size: default is 8kb; if full then the output will be printed and so jsp:forward and jsp:redirect will not work because nothing must be printed before --%>
<%@ page session="true" %>
<%@ page import="java.net.URLEncoder"%>
<%@ page import="view.HTMLUIcomponents.AbstractComponent"%>
<%@ page import="model.DHTMLConstants"%>


<%



// only raise the value, if the last visited element differs from the actual one:
//if( 	request.getParameter("id") != null && 
//		AbstractDataConnector.getURI( request.getParameter("id") ) != null && 
//		( session.getAttribute( "clickhistory[0]" ) != null && 
//	!((String)session.getAttribute( "clickhistory[0]" )).equals( AbstractDataConnector.getURI( request.getParameter("id") ).toString() ) ) ) {
//	controller.ElementRanker.RaiseValueOfElement( AbstractDataConnector.getURI( request.getParameter( "id" ) ) );
//}

// above should be activated after Kathis OK (below deleted). State: 20.7.2007

URI uri = AbstractDataConnector.getURI( request.getParameter("id") );
URI type = AbstractDataConnector.getType( uri );
String title = null;

if( 	request.getParameter("id") != null && 
		uri!=null && 
		session.getAttribute( "clickhistory[0]" ) != null ) {
	
	// check type:
	if( type!=null ) {
		if( type.equals( Vocabulary.CLASS ) || type.equals( Vocabulary.ONTOLOGYMODULE ) || type.equals( Vocabulary.OBJECTPROPERTY ) || type.equals( Vocabulary.DATATYPEPROPERTY ) ) {
	
			//controller.ElementRanker.RaiseValueOfElement( uri );
			
			title = Mapper.selectLabel( uri, Vocabulary.ENGLISH );
		}
	}
}

%>

<%@page import="java.util.Enumeration"%>
<%@page import="org.myontology.controller.pages.DisplayProperties"%>
<%@page import="org.myontology.users.Login"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    <title>myOntology<%
    
    if( title!=null )
    	out.println( StringEscapeUtils.escapeHtml( " : " + title ) );
    
    %></title>
    <% String base = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+ request.getContextPath();%>
	<base href="<%=base%>/" ></base>
	
	<link rel="icon" href="favicon.ico" type="image/x-icon" />
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
	
	<script language="javascript">
		var canCreate = <%=Login.CURRENT_USER.getValue(request)==null?"false":"true"%>
	</script>
	
	<script type="text/javascript" src='<%=base+ "/javascript/dojo.js"%>'>
		var djConfig = {bindEncoding:"UTF-8", isDebug: false};
	</script>
	

<!--  script type="text/javascript" src="javascript/pngfix.js"></script-->

	<!-- script type="text/javascript">
		var djConfig = {bindEncoding:"UTF-8", isDebug: false,parseOnLoad:true};
	</script>
	<script type="text/javascript" src='<%=base+ "/javascript/dojo-1.1/dojo/dojo.js"%>'></script-->
	
	<script type="text/javascript">
	  var dlg;
	</script>
	<script src="javascript/Ajax4Suggest.js" type="text/javascript"></script>
	<script language="JavaScript" type="text/javascript" src="javascript/ajaxcommunicator.js"></script>
	<script language="JavaScript" type="text/javascript" src="javascript/handleajaxresponses.js"></script>

	<script language="JavaScript" type="text/javascript" src="javascript/sorttable.js"></script>
	<script language="JavaScript" type="text/javascript" src="javascript/setFormValue.js"></script>
	<script language="JavaScript" type="text/javascript" src="javascript/functions.js"></script>
	<script language="JavaScript" type="text/javascript" src="javascript/import.js"></script>
	<script language="JavaScript" type="text/javascript" src="javascript/tabber-minimized.js"></script>
	<script language="JavaScript" type="text/javascript" src="/fckeditor/fckeditor.js"></script>	
	<script language="JavaScript" type="text/javascript" src="javascript/mootools.v1.11.myontology.js"></script>
	<script language="JavaScript" type="text/javascript" src="javascript/dropdown.js"></script>
	<script language="JavaScript" type="text/javascript" src="javascript/disable_formsubmit_onenter.js"></script>
	
	
	<link rel="stylesheet" type="text/css" href="skins/default/stylesheets/ajax4suggest.css" />    
	<link rel="stylesheet" type="text/css" href="skins/default/stylesheets/container.css" />    
	<link rel="stylesheet" type="text/css" href="skins/default/stylesheets/page.css" />  
	<link rel="stylesheet" type="text/css" href="skins/default/stylesheets/tabber.css" />
<%
try {
//	 link to RDF-file containing all ontologies:
	
	if( request.getParameter("id")==null ) {
		// Homepage:
%>
	<link rel="alternate" type="application/rdf+xml" title="RDF Version" href="index.rdf-xml.owl" />
<%	
	}
	else if( request.getParameter("action")==null ) {
		
		if( type!=null && ( type.equals( Vocabulary.ONTOLOGYMODULE )  || type.equals( Vocabulary.CLASS )|| type.equals( Vocabulary.DATATYPEPROPERTY ) || type.equals( Vocabulary.OBJECTPROPERTY ) ) ) { 
%>
	<link rel="alternate" type="application/rdf+xml" title="RDF Version" href="<%= response.encodeURL( AbstractDataConnector.getURI( request.getParameter("id") ).toString() ) %>.rdf-xml.owl" />
<%
		} 
	}
} catch (Exception e ) {
	System.err.println( e );
}
%>	

  		

	
</head>
<body onload="if(document.getElementById('<%= Label.NAMEFORMELEMENT %>')) { document.getElementById('<%= Label.NAMEFORMELEMENT %>').focus(); };alpha();">	
<script language="JavaScript" src="javascript/wz_tooltip.js" type="text/javascript"></script>


<%
String action = request.getParameter("action");

if( action==null || !( action.equals( "newClass" ) || action.equals( "newProperty" ) || action.equals( "newOntologyModule" ) ) ) {


%>

<div id="_top" style="margin:0px 0px 0px 0px;">

	<div style="float:left;">
		<a href="" title="Home"><% if (Login.IS_SANDBOX(request)){%><h1>&nbsp;SANDBOX</h1><% }else {%><img src="skins/default/images/layout/myontology.png" alt="myOntology" title="myOntology beta version. Please note that this is a prototype. Data loss might occur." style="border:none;" /><% }%></a>
	</div>
	
	<%if (DisplayProperties.HIDE_NAVIGATION.getValue(request)==null) { %>
	
	<div style="padding: 23px 26px 0px 0px; text-align: right; ">

		<%@include file="components/header.jsp" %>

	</div>
	
	<%} %>
	
	<div class="clearer">&nbsp;</div>

</div>
<%
	if (DisplayProperties.HIDE_TREE.getValue(request)==null) {
%>
<!-- <div style=" float:left; display:block; width: 165px; margin:20px 0px 0px 10px;"> -->
 
<div onmouseover="javascript:setTreeDimension(true);"
     style="margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px;filter:alpha(opacity=75);-moz-opacity:.75;opacity:.75;">
  <div dojoType="FloatingPane" id="FloatingPane"
    style="margin-left: 5px; margin-top: 20px;position:absolute;"
	hasShadow="false"
	resizable="false"
	titleBarDisplay="false"
	displayMinimizeAction="false"
	displayMaximizeAction="false"
	constrainToContainer="false"
	windowState="normal">

	<h4 style="margin-top:0px; padding-top:0px;"><%= Labels.CLASS.getNameSingular() %> Hierarchy</h4>
	<%@include file="components/classcomponents/showGlobalConceptTree.jsp" %>
   </div>
</div>
 
<div id="_middle" style="margin-top: 3px;  margin-left: 160px;" onmouseover="javascript:setTreeDimension(false);">
<%
	}
	else {
%>
<div id="_middle" style="margin-top: 3px;">
<%
	}
}
else {
%>
<div id="_middle" style="margin-top: 10px; ">
<%
}
%>
	<div style="background-image: url(skins/default/images/layout/leftup.png); background-position: left bottom; background-repeat:no-repeat;">
		<div style="background-image: url(skins/default/images/layout/rightup.png); background-position: right bottom; background-repeat:no-repeat; margin-left: 50px;">
			<div style="margin-right: 45px;">				
				<div style="width:100%; background-image: url(skins/default/images/layout/up.png); background-position:bottom; background-repeat:repeat-x;">
				
					<%@include file="components/navigation.jsp" %>
						
				</div>
			</div>
		</div>
	</div>	
	
	<div style="background-image: url(skins/default/images/layout/lefttop.png); background-position: left bottom; background-repeat:no-repeat;">
		<div style="background-image: url(skins/default/images/layout/righttop.png); background-position: right bottom; background-repeat:no-repeat; margin-left: 28px;">
			<div style="margin-right: 27px;">				
				<div style="width:100%; height:18px; background-color: #FFFFFF;">
					&nbsp;
				</div>
			</div>
		</div>
	</div>

	<div style="background-image: url(skins/default/images/layout/left.png); background-repeat:repeat-y;">
		<div style="background-image: url(skins/default/images/layout/right.png); background-position: right; background-repeat:repeat-y; margin-left: 28px;">
			<div style="margin-right: 27px;">				
				<div style="width:100%; background-color: rgb(255, 255, 255);">
					
					<div style="height:4px;"></div>
					
					<div id="content" style=" margin:0px 23px 0px 27px;">
						
						<%@include file="components/main.jsp" %>
						
						<div class="clearer">&nbsp;</div>
					</div>
										
					<div style="height:4px;"></div>
					
				</div>
			</div>
		</div>
	</div>
	
	
	<div style="background-image: url(skins/default/images/layout/leftlow.png); background-repeat:no-repeat;">
		<div style="background-image: url(skins/default/images/layout/rightlow.png); background-position: right; background-repeat:no-repeat; margin-left: 50px;">
			<div style="margin-right: 45px;">				
				<div style="width:100%; height:44px; background-image: url(skins/default/images/layout/low.png); background-position:top; background-repeat:repeat-x;">&nbsp;</div>
			</div>
		</div>
	</div>
	
	
	<div class="clearer">&nbsp;</div>
	
</div>


<div id="bottom" style="clear:both;">
	<div id="disclaimer">
		<div>Credits and Attribuition:



myOntology and its modules include work contributed my many individuals and organizations under a <a href="http://creativecommons.org/licenses/by/3.0/" target="_blank">Creative Commons Attribution 3.0 license</a></div>
		<div>*) This product uses the <a href="http://www.flickr.com/services/api/" target="_blank" style="color:#c0c0c0;">Flickr API</a> but is not endorsed or certified by <a href="http://www.flickr.com" target="_blank" style="color:#c0c0c0;">Flickr</a>.</div>
		<div>**) This product uses the <a href="http://www.youtube.com/dev_docs" target="_blank" style="color:#c0c0c0;">YouTube API</a> but is not endorsed or certified by <a href="http://www.youtube.com" target="_blank" style="color:#c0c0c0;">YouTube</a>.</div>
		<div>Icons by <a href="http://famfamfam.com/" target="_blank" style="color:#c0c0c0;">famfamfam</a>.</div>
		<div>&copy; 2006-2008 <a href="http://www.sti-innsbruck.at" target="_blank" style="color:#c0c0c0;">STI Innsbruck</a>. All rights reserved.</div>
	</div>
</div>	
	
</body>
</html>
